-
Notifications
You must be signed in to change notification settings - Fork 25
/
Installation Manual.md
323 lines (98 loc) · 5.82 KB
/
Installation Manual.md
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
# Installation Manual
#### Contents
1. [Preparation](#Preparation)
2. [Download Geochemistry π](#Download-Geichemistry—π)
3. [Solutions and Suggestions for Installation Failure](#Solutions)
## 1. Preparation <a name="Preparation"> </a>
### 1.1 Install Python Interpreter
A Python interpreter is a program that reads and executes Python code. When you write Python code in a text file with a `.py` extension, you can run that file using the Python interpreter. For example, use `python main.py` to executes the codes inside main.py file in command line or terminal.
The normal ways to install Python interpreter:
(1) If you are a Windows user, you can use Microsoft Store App to download directly by searching Python.
(2) Refer to the download section in [Python official documentation](https://www.python.org).
(3) If you are Chinese users, you can refer to this blog [Python Download - RUNOOB](https://www.runoob.com/python/python-install.html) to download too.
### 1.2 Install Conda
Conda allows you to easily install, update, and manage Python packages and dependencies. Usually, Conda is included the software Anaconda. Hence, by downloading Anaconda, you can install Conda too.
The normal ways to install Anaconda:
(1) Refer to the download section in [Anaconda website](https://www.anaconda.com).
(2) If you are Chinese users, you can refer to [Anaconda Download - Zhihu](https://zhuanlan.zhihu.com/p/459601766) to download Anaconda using Tsinghua mirror source Anaconda. Also, if you are not familiar with Command Prompt (CMD) in Windows, you can reference to [Frequently Used Commands on Windows - Zhihu](https://zhuanlan.zhihu.com/p/67513308).
## 2. Download Geochemistry π in Virtual Environment <a name="Download-Geichemistry—π"> </a>
### 2.1 Create A Virtual Environment
Use Conda to manage virtual environments (recommended) :
(1) Creates a virtual environment by installing the python interpreter, for example, to install a version 3.9 python interpreter, where `env_name` is the name of the created environment. To avoid version problems, it is better to use 3.9 version of python.
On Mac Terminal:
```
conda create -n vir_env_name python=3.9
```
On Windows Command Prompt:
```
conda create -n vir_env_name python=3.9
```
***\*Note:\****
1. In the command, 'vir_env_name' can be replaced by any name you want, like 'Geochemical_project'. Remember it's better not using Chinese characters.
2. Please remember that our project are stable in 'python=3.9'. Other versions would make unkown mistakes.
3. When meeting problems in the installation. Please check the python version first.
For the prompting information, input `y` to continue until the configuration is done.
(2) Activate the created virtual environment.
On Mac Terminal:
```
conda activate vir_env_name
```
On Windows Command Prompt:
```
conda activate vir_env_name
```
For more useful Conda commands, please search online.
### 2.2 Use pip to Download
After the virtual environment is activated on your computer, you can follow the steps below to download our software:
(1) Clear the cache packages:
On Mac Terminal:
```
pip cache purge
```
On Windows Command Prompt:
```
pip cache purge
```
(2) Download our software:
On Mac Terminal:
```
pip install geochemistrypi
```
On Windows Command Prompt:
```
pip install geochemistrypi
```
(3) Check the latest version of our software:
On Mac Terminal:
```
geochemistrypi --version
```
On Windows Command Prompt:
```
geochemistrypi --version
```
***\*Note\****: Domestic direct installation may stop because of network speed problems in ray or Fiona package installation failure. You can reference the following video to resolve the problem.
+ [Possible Scenarios When Installing via pip Directly in China.mp4](https://www.bilibili.com/video/BV1Gs4y1d7Cm/?spm_id_from=333.999.0.0&vd_source=350db2ec0e0c3ee7f424928a21e82674)
## 3. Solutions and Suggestions for Installation Failure <a name="Solutions"> </a>
### 3.1 Use Tsinghua Mirror Source
If you cannot download our software because Ray/Fiona downloads are too slow or just fail , you can use the pip with Tsinghua mirror source to re-download the package in terms of the specific error.
```
pip install ray -i https://pypi.tuna.tsinghua.edu.cn/simple
```
+ Reference video: [Solutions to Failures in Direct pip Installation in China.mp4](https://www.bilibili.com/video/BV1zg4y1j7bx/?spm_id_from=333.999.0.0&vd_source=350db2ec0e0c3ee7f424928a21e82674).
### 3.2 Use 'pip install -r requirements/production.txt'
Another way to download related dependecies is to clone the source code from GitHub or Gitee repository firstly:
GitHub Link: https://github.com/ZJUEarthData/geochemistrypi
Gitee Link: https://gitee.com/zju-earth-data/geochemistrypi
After that, unpacking the source code file. Open Terminal on Mac or Command Promt on Window and navigate to the directory to the source code file, use the following command to download the dependency :
```
pip install -r requirements/production.txt
```
Or use the Tsinghua mirror source to download:
```
pip install -r requirements/production.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
```
+ Reference video: [The Fastest Currently Feasible Installation Method in China—Installing from GitHub Using requirements.mp4](https://www.bilibili.com/video/BV1pM411V7iR/?spm_id_from=333.999.0.0&vd_source=350db2ec0e0c3ee7f424928a21e82674)
***\*Note\****: Actually this method can be used for developers to test our latest updates. For more information, please refer to our online documentation in ***\*Local Deployment\**** under the section of ***\*FOR DEVELOPER\****.
### 3.3 Report An Error to Our Team
You can refer to our online documentation in ***\*Contact Us\**** under the section of ****FOR USER****.